<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>移动应用图标库</title>
    <!-- 引入 sql.js 库 -->
    <script src="https://cdn.jsdelivr.net/npm/sql.js@1.8.0/dist/sql-wasm.js"></script>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="header">
        <h1>移动应用图标库</h1>
        <div class="header-buttons-right">
            <button id="create-btn" class="gallery-btn" title="创建图标" onclick="window.location.href='create.html'">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon">
                    <path d="M12 5v14M5 12h14"></path>
                </svg>
                <span>创建图标</span>
            </button>
            
            <!-- 三个点的菜单按钮 -->
            <div class="dropdown">
                <button id="more-options-btn" class="gallery-btn" title="更多选项">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon">
                        <circle cx="12" cy="6" r="1"></circle>
                        <circle cx="12" cy="12" r="1"></circle>
                        <circle cx="12" cy="18" r="1"></circle>
                    </svg>
                </button>
                <div id="dropdown-menu" class="dropdown-content">
                    <a href="preview.html" id="svg-preview-option">SVG预览</a>
                    <a href="remove_background.html" id="remove-bg-option">移除背景</a>
                    <a href="crop_image.html" id="crop-image-option">图片裁剪</a>
                    <a href="colorize.html" id="colorize-option">图片改色</a>
                    <a href="color_picker.html" id="color-picker-option">取色</a>
                    <a href="measure.html" id="measure-option">测距</a>
                </div>
            </div>
        </div>
    </div>

    <!-- Gallery Dialog -->
    <div class="gallery-content">
        <div class="gallery-header">
            <h2>移动应用图标库</h2>
            <div class="gallery-actions">
                <button id="import-db-btn">导入数据库</button>
                <input type="file" id="db-file-input" accept=".db" style="display: none;">
            </div>
        </div>
        <div class="gallery-filters">
            <label for="category-filter">分类:</label>
            <select id="category-filter">
                <option value="all">全部</option>
                <!-- 分类选项将通过 JavaScript 动态添加 -->
            </select>
            <label for="style-filter">风格:</label>
            <select id="style-filter">
                <option value="all">全部</option>
                <!-- 风格选项将通过 JavaScript 动态添加 -->
            </select>
            <input type="text" id="search-input" placeholder="搜索图标...">
            <label for="items-per-page">每页显示:</label>
            <select id="items-per-page">
                <option value="12">12</option>
                <option value="24" selected>24</option>
                <option value="48">48</option>
                <option value="96">96</option>
            </select>
        </div>
        <div class="gallery-container" id="gallery-container"></div>
        <div class="pagination-controls" id="pagination-controls">
            <button id="first-page">首页</button>
            <button id="prev-page">上一页</button>
            <span id="page-info"></span>
            <button id="next-page">下一页</button>
            <button id="last-page">末页</button>
        </div>
    </div>


    
    <div class="status-bar" id="status-bar">准备就绪</div>
    <script src="index.js"></script>
</body>
</html>